put the hilite of card button "TimeCheck" into timeCheck
end openCard
on idle
alarmcheck
pass idle
end idle
on alarmCheck
global timeCheck
if NOT timeCheck then exit alarmCheck
put the long time into thingg
convert thingg to dateitems
if item 6 of thingg > 0 then exit alarmCheck
put item 4 of thingg into thHour
if thHour>12 then subtract 12 from thHour
put item 5 of thingg into thMins
if thMins MOD 15 = 0 then
put thMins DIV 15 into quarter
if quarter=0 then put 4 into quarter
chime thHour,quarter
end if
wait until the sound is "done"
end alarmCheck
on chime
put param(1) into hh
put param(2) into qq
play "Harpsichord" e c d g3h
if qq>1 then play "Harpsichord" g3q d4 e ch
if qq>2 then play "Harpsichord" e d c g3h
if qq>3 then
play "Harpsichord" g3q d4 e cw
repeat for hh
play "Harpsichord" c3w
end repeat
end if
end chime
-- part 1 (button)
-- low flags: 00
-- high flags: E005
-- rect: left=414 top=121 right=135 bottom=508
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: TimeCheck
----- HyperTalk script -----
on mouseUp
global timeCheck
put the hilite of the target into timeCheck
end mouseUp
-- part contents for background part 1
----- text -----
Chime the Time
-- part contents for background part 3
----- text -----
-- Install this into the Home Card stack scripts:
--
-- include these lines in an initialization handler (see 'home
-- initializations' for more information):
global timecheck
put the hilite of card button "TimeCheck" into timeCheck
--
-- include alarmcheck in the 'on idle' handler, for example:
--
on idle
alarmcheck
pass idle
end idle
--
-- include these handlers in the stack script:
--
on alarmCheck
global timeCheck
if NOT timeCheck then exit alarmCheck
put the long time into thingg
convert thingg to dateitems
if item 6 of thingg > 0 then exit alarmCheck
put item 4 of thingg into thHour
if thHour>12 then subtract 12 from thHour
put item 5 of thingg into thMins
if thMins MOD 15 = 0 then
put thMins DIV 15 into quarter
if quarter=0 then put 4 into quarter
chime thHour,quarter
end if
wait until the sound is "done"
end alarmCheck
on chime
put param(1) into hh
put param(2) into qq
play "Harpsichord" e c d g3h
if qq>1 then play "Harpsichord" g3q d4 e ch
if qq>2 then play "Harpsichord" e d c g3h
if qq>3 then
play "Harpsichord" g3q d4 e cw
repeat for hh
play "Harpsichord" c3w
end repeat
end if
end chime
-- part contents for background part 4
----- text -----
This feature will check the time and when a quarter-hour, half-hour, three quarter-hour or hour time occurs, then the appropriate chimes will sound. It is possible to change the sound to something other than the "Harpsichord". This set of scripts could possibly be expanded to include checking for other events, such as appointments in a calendar, etc. To install "Chime the Time", copy the scripts shown below into your Home Card stack script (or any card or stack script). Also copy the "TimeCheck" card button to your Home Card.
(Note: the handlers have been installed into the script of this card)